<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    html,body{
      height: 100%;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: #1c1c1c;

    }
    .box{
      position: relative;
      width: 380px;
      height: 420px;
      background-color: #1d2b3a;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      overflow: hidden;
    }
    .box::before{
      content: '';
      position: absolute;
      top: -50%;
      left: -50%;
      width: 380px;
      height: 420px;
      background: linear-gradient(0deg,transparent,#45f3ff,#45f3ff);
      transform-origin: bottom right;
      animation: animate 6s linear infinite;
    }
    .box::after{
      content: '';
      position: absolute;
      top: -50%;
      left: -50%;
      width: 380px;
      height: 420px;
      background: linear-gradient(0deg,transparent,#45f3ff,#45f3ff);
      transform-origin:  bottom right;
      animation: animate 6s linear infinite;
      /* 
      parmas:
      正数：延迟执行秒数
      负数：立刻执行，但跳过3秒动画
      */
      animation-delay: -3s;
    }
    @keyframes animate{
      0%{
        transform: rotate(0deg);
      }
      100%{
        transform: rotate(360deg);
      }
    }
    .form{
      position: absolute;
      z-index: 10;
      inset: 2px;
      background: #28292d;
      border-radius: 8px;
      padding: 50px 40px;
      display: flex;
      align-items: center;
      flex-direction: column;
      gap: 35px;
    }
    .form h2{
      color: #45f3ff;
      font-size: 500;
      text-align: center;
      letter-spacing: 0.1em;
    }
    .inputBox{
      position: relative;
      width: 100%;
    }
    .inputBox input{
      width: 100%;
      padding: 10px;
      border: 1px solid rgba(255, 255,255, 0.25);
      background-color: #1d2b3a;
      border-radius: 5px;
      outline: none;
      color: #fff;
      font-size: 1em;
      transition: 0.5s;
    }
    .inputBox span{
      position: absolute;
      left: 0;
      padding: 10px;
      /* 鼠标事件：选中，点击 */
      pointer-events: none;
      font-size: 1em;
      color: rgba(255, 255,255, 0.25);
      /* 转换文字的样式 */
      text-transform: uppercase;
      transition: 0.5s;
    }
    /* 合法输入时的样式：即有输入时的span */
    .inputBox input:valid ~ span,
    .inputBox input:focus ~ span
    {
      color:#00dfc4;
      transform: translateX(10px) translateY(-7px);
      font-size: 0.65em;
      padding: 0 10px;
      background-color: #1d2b3a;
      border-left: 1px solid #00dfc4;
      border-right: 1px solid #00dfc4;
      letter-spacing: 0.2em;
    }
    .inputBox:nth-child(2) input:valid ~ span,
    .inputBox:nth-child(2) input:focus ~ span{
      background: #00dfc4;
      color: #fff;
    }
    .inputBox input:valid ,
    .inputBox input:focus {
      border: 1px solid #00dfc4;
    }
    .links{
      display: flex;
      justify-content: space-between;
      width: 100%;

    }

    .links a{
      margin: 10px 0;
      font-size: 0.75em;
      color: #8f8f8f;
      text-decoration: none;
    }
    .links a:hover,
    .links a:nth-child(2){
      color: #00dfc4;
    }
    input[type='submit']{
      float: left;
      border: none;
      outline: none;
      background-color: #00dfc4;
      padding: 11px 25px;
      width: 100px;
      border-radius: 4px;
      font-weight: 600;
      width: 80%;
      cursor: pointer;
    }
  </style>
</head>
<body>
  <div class="box">
    <div class="form">
      <h2>Sign in</h2>
      <div class="inputBox">
        <input type="text" required="required">
        <span>First Name</span>
      </div>
      <div class="inputBox">
        <input type="text" required="required">
        <span>Last Name</span>
      </div>
      <div class="links">
        <a href="#">Forgot Password</a>
        <a href="#">Signup </a>
      </div>
      <input type="submit" value="Login">
    </div>
  </div>

</body>
</html>